<!DOCTYPE html>
<html>
    <head>
        <!-- 页面meta -->
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>智慧农业</title>
        <meta name="description" content="智慧农业">
        <meta name="keywords" content="智慧农业">
        <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
        <!-- 引入样式 -->
        <link rel="stylesheet" href="../plugins/elementui/index.css">
        <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
        <link rel="stylesheet" href="../css/style.css">
        <style>
            .grid-content {
                border-radius: 4px;
                min-height: 40px;
            }
        </style>
    </head>
    <body class="hold-transition">
        <div id="app">
            <div class="content-header">
                <h1>统计分析<small>大棚信息</small></h1>
                <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
                    <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
                    <el-breadcrumb-item>统计分析</el-breadcrumb-item>
                    <el-breadcrumb-item>大棚信息</el-breadcrumb-item>
                </el-breadcrumb>
            </div>
            <div class="app-container">
                <div class="box" style="height: 900px">
                    <div class="excelTitle" >
                        <el-button @click="exportExcel">导出Excel</el-button>
                    </div>
                    <div class="excelTime"></div>
                    <table class="exceTable" cellspacing="0" cellpadding="0" style="text-align: center;font-size: small">
                        <tr>
                            <td colspan="17" class="headBody">大棚信息表</td>
                        </tr>
                        <tr>
                            <td width="5%" class="tabletrBg">大棚编号</td>
                            <td width="5%" class="tabletrBg">种植种类</td>
                            <td width="5%" class="tabletrBg">种植数量</td>
                            <td width="5%" class="tabletrBg">生长状态</td>
                            <td width="5%" class="tabletrBg">室内温度</td>
                            <td width="5%" class="tabletrBg">空气湿度</td>
                            <td width="4.5%" class="tabletrBg">土壤湿度</td>
                            <td width="5%" class="tabletrBg">土壤PH值</td>
                            <td width="4.5%" class="tabletrBg">CO2含量</td>
                            <td width="4.5%" class="tabletrBg">光照强度</td>
                            <td width="5%" class="tabletrBg">空气质量</td>
                            <td width="5%" class="tabletrBg">补光灯状态</td>
                            <td width="5%" class="tabletrBg">摄像头状态</td>
                            <td width="5%" class="tabletrBg">浇灌状态</td>
                            <td width="5%" class="tabletrBg">非法闯入</td>
                            <td width="4.5%" class="tabletrBg">是否异常</td>
                            <td width="4%" class="tabletrBg">负责人</td>
                        </tr>
                        <tr v-for="s in reportData.tableData">
                            <td width="5%" class="tabletrBg">{{s.id}}</td>
                            <td width="5%" class="tabletrBg">{{s.crop}}</td>
                            <td width="5%" class="tabletrBg">{{s.crop_num}}</td>
                            <td width="5%" class="tabletrBg">{{s.grow}}</td>
                            <td width="5%" class="tabletrBg">{{s.room_wendu}}</td>
                            <td width="5%" class="tabletrBg">{{s.kong_shidu}}</td>
                            <td width="4.5%" class="tabletrBg">{{s.tu_shi}}</td>
                            <td width="5%" class="tabletrBg">{{s.ph}}</td>
                            <td width="4.5%" class="tabletrBg">{{s.co2}}</td>
                            <td width="4.5%" class="tabletrBg">{{s.sun}}</td>
                            <td width="5%" class="tabletrBg">{{s.kong_zhi}}</td>
                            <td width="5%" class="tabletrBg">{{s.buguang}}</td>
                            <td width="5%" class="tabletrBg">{{s.shexiang}}</td>
                            <td width="5%" class="tabletrBg">{{s.jiaoguan}}</td>
                            <td width="5%" class="tabletrBg">{{s.chuangru}}</td>
                            <td width="4.5%" class="tabletrBg">{{s.huanjing}}</td>
                            <td width="4%" class="tabletrBg">{{s.fuzeren}}</td>
                        </tr>



                    </table>
                </div>
        </div>
        </div>
    </body>
    <!-- 引入组件库 -->
    <script src="../js/vue.js"></script>
    <script src="../plugins/elementui/index.js"></script>
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script src="../js/axios-0.18.0.js"></script>
    <script>
        var vue = new Vue({
            el: '#app',
            data:{
                reportData:{
                    tableData: [{
                        id: 1,
                        crop: '玉米',
                        crop_num: 200,
                        grow:'正常',
                        room_wendu:'20%',
                        kong_shidu:'50%',
                        tu_shi:'70%',
                        ph:'7',
                        co2:'0.05%',
                        sun:'5000lx',
                        kong_zhi:'良好',
                        buguang:'开启',
                        shexiang:'开启',
                        jiaoguan:'关闭',
                        chuangru:'否',
                        huanjing:'正常',
                        fuzeren:'好人'
                    },{
                        id: '2',
                        crop: '玉米',
                        crop_num: '200',
                        grow:'正常',
                        room_wendu:'20',
                        kong_shidu:'50',
                        tu_shi:'70',
                        ph:'7',
                        co2:'0.05%',
                        sun:'5000lx',
                        kong_zhi:'良好',
                        buguang:'开启',
                        shexiang:'开启',
                        jiaoguan:'关闭',
                        chuangru:'否',
                        huanjing:'正常',
                        fuzeren:'好人'

                    }]
                }
            },
            created() {
                axios.get("/report/getBusinessReportData.do").then((res)=>{
                    if(res.data.flag){
                        this.reportData.tableData = res.data.data;
                    }else {
                        this.$message.error(res.data.message);
                    }

                });
            },
            methods:{
                exportExcel(){
                    window.location.href = '/report/exportBusinessReport.do';
                }
            }
        })
    </script>
</html>
